solving linear systems using the substitution method